package com.yami.shop.bean.model;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yami.shop.bean.app.dto.FaceDesignConfigDto;
import com.yami.shop.bean.serializer.json.FaceDesignConfigDeserializer;
import com.yami.shop.bean.serializer.json.FaceDesignConfigSerializer;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 人脸设计稿表实体类
 * @author AI Assistant
 */
@Data
@TableName("tz_face_design")
public class FaceDesign implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 设计稿ID
     */
    @TableId
    private Long designId;

    /**
     * 用户ID
     */
    private String userId;

    /**
     * 关联草稿ID
     */
    private Long draftId;

    /**
     * 设计稿名称
     */
    private String designName;

    /**
     * 人脸底图ID
     */
    private Long faceBaseId;

    /**
     * 五官配置JSON
     */
    @JsonSerialize(using = FaceDesignConfigSerializer.class)
    @JsonDeserialize(using = FaceDesignConfigDeserializer.class)
    @TableField(typeHandler = com.yami.shop.bean.handler.FaceDesignConfigTypeHandler.class)
    private FaceDesignConfigDto featureConfig;

    /**
     * 预览图URL
     */
    private String thumbnailUrl;

    /**
     * 设计稿状态 1:草稿 2:已完成 3:已发布
     */
    private Integer designStatus;

    /**
     * 是否公开 1:公开 0:私有
     */
    private Integer isPublic;

    /**
     * 查看次数
     */
    private Integer viewCount;

    /**
     * 点赞次数
     */
    private Integer likeCount;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    /**
     * 关联的用户信息
     */
    @TableField(exist = false)
    private User user;

    /**
     * 关联的人脸底图信息
     */
    @TableField(exist = false)
    private FaceBase faceBase;

    /**
     * 关联的草稿信息
     */
    @TableField(exist = false)
    private FaceDraft faceDraft;
}